import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:hook_rent/routes.dart';
import 'package:hook_rent/widgets/app_bar.dart';

class PageContent extends StatelessWidget {
  final String name;
  const PageContent({super.key, required this.name});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: buildAppBar(title: "当前页面：$name"),
      body: ListView(
        children: [
          TextButton(
              onPressed: () {
                Get.offAllNamed(Routes.HOME);
              },
              child: const Text(Routes.HOME)),
          TextButton(
              onPressed: () {
                Get.toNamed(Routes.LOGIN);
              },
              child: const Text(Routes.LOGIN)),
          TextButton(
              onPressed: () {
                Get.toNamed(Routes.ROOMDETAIL, arguments: {"id": 5555});
              },
              child: const Text(Routes.ROOMDETAIL))
        ],
      ),
    );
  }
}
